home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 27.zip / BS1 part 27 / DeluxeMusic2_d1.adf / Install-DeluxeMusic < prev    next >
Text File  |  1993-06-07  |  15KB  |  671 lines

  1. ; Installation script for DeluxeMusic 2.0
  2. ; $VER: Install-DMusic 0.6 (28-4-93)
  3.  
  4. ; Tell user that the installer will be creating a drawer for the program.
  5. ; Also the program will be installing some libraries (under 1.3 only).
  6.  
  7. ; Things that go in DMusic Drawer:
  8. ;  DMusic.info
  9. ;  DMusic
  10. ;  DMPlayer.info
  11. ;  DMPlayer
  12. ;  Samples.info (disk 2)
  13. ;  Samples/#? (disk 2)
  14. ;  Scores.info (disk 2)
  15. ;  Scores/#? (disk 2)
  16. ; Things that go in system places (*** only if doesn't exist):
  17. ;  Rexx/#?
  18. ;  Fonts/Duet
  19. ;  Fonts/GuitarFret
  20. ;  Fonts/DMusic
  21. ;  Libs/camd.library ***
  22. ;  Libs/realtime.library ***
  23. ;  Libs/iffparse.library  *** 1.3 only
  24. ;  Libs/gadtools13.library *** 1.3 only
  25. ;  Libs/asl13.library *** 1.3 only
  26. ;  Devs/Midi/checkpoint (optional)
  27. ;  Devs/Midi/OneStopMusicShop (optional)
  28.  
  29. ; some 'constants'
  30.  
  31. (set app_volume_name_1 "DeluxeMusic2.0")
  32. (set app_volume_name_2 "Samples")
  33. (set app_volume_1 "DeluxeMusic2.0:")
  34. (set app_volume_2 "Samples:")
  35. (set orig_user_level @user-level)
  36.  
  37. ; determine version of OS
  38.  
  39. (set os13 (<= (/ (getversion) 65536) 35))
  40.  
  41. ; ask user if this is a floppy or harddisk installation
  42. ; switch user level to EXPERT do this
  43.  
  44. (user 2)
  45.  
  46. (set inst_mode
  47.     (askbool
  48.         (prompt
  49.             "DeluxeMusic 2.0 must be registered before use. This can be done "
  50.             "at the same time that the program is installed on a hard drive "
  51.             "(or other storage device), or can be performed on a copy of the "
  52.             "DeluxeMusic 2.0 floppy disk. Which form of installation do you "
  53.             "want performed?"
  54.         )
  55.         (help
  56.             "Click on \"Hard Drive\" to install DeluxeMusic 2.0 to a hard drive.\n"
  57.             "Click on \"Floppy Disk\" to register the program on this floppy disk."
  58.         )
  59.         (choices "Hard Drive" "Floppy Disk")
  60.     )
  61. )
  62.  
  63. ; switch user level back
  64.  
  65. (user orig_user_level)
  66.  
  67. (complete 5)
  68.  
  69. ; SUBROUTINES
  70.  
  71. (procedure ask_register
  72.     (
  73.         ; switch use mode (again)
  74.  
  75.         (user 2)
  76.  
  77.         (set user_ok 0)
  78.  
  79.         (while (not user_ok)
  80.  
  81.             (
  82.                 (set user_name "")
  83.  
  84.                 (while (= user_name "")
  85.                     (
  86.                         (set user_name
  87.                             (askstring
  88.                                 (prompt
  89.                                     "As part of the registration process, please answer the "
  90.                                     "following questions:\n\nWhat is your name?"
  91.                                 )
  92.                                 (help @askstring-help)
  93.                             )
  94.                         )
  95.  
  96.                         (if (patmatch "# " user_name) (set user_name ""))
  97.                     )
  98.                 )
  99.  
  100.                 (set user_org
  101.                     (askstring
  102.                         (prompt "What is the name of your organization (if any)?")
  103.                         (help @askstring-help)
  104.                     )
  105.                 )
  106.  
  107.                 (set reg_number "")
  108.  
  109.                 (while (= reg_number "")
  110.                     (
  111.                         (set reg_number
  112.                             (askstring
  113.                                 (prompt
  114.                                     "What is the registration number on your "
  115.                                     "original DeluxeMusic 2.0 registration card?"
  116.                                 )
  117.                                 (help @askstring-help)
  118.                             )
  119.                         )
  120.  
  121.                         (if (patmatch "# " reg_number)
  122.                             (set reg_number "")
  123.                         )
  124.                     )
  125.                 )
  126.  
  127.                 (set user_ok
  128.                     (askbool
  129.                         (prompt
  130.                             (cat
  131.                                 "Is this information correct?\n\n"
  132.                                 user_name "\n"
  133.                                 user_org "\n"
  134.                                 reg_number
  135.                             )
  136.                         )
  137.                         (help
  138.                             "Click \"Yes\" if the information is correct.\n"
  139.                             "Click \"No\" to re-enter the registration information."
  140.                         )
  141.                     )
  142.                 )
  143.             )
  144.         )
  145.  
  146.         ; switch user level back
  147.  
  148.         (user orig_user_level)
  149.     )
  150. )
  151.  
  152. (procedure do_register
  153.     (
  154.         (set user_ok 0)
  155.  
  156.         (run
  157.             (cat "\"" (tackon app_volume "DeluxeMusic/c/register") "\" \""
  158.                 app_xpath "\" \"" user_name "\" \"" user_org "\" " reg_number
  159.             )
  160.         )
  161.  
  162.         ; switch use mode (again)
  163.  
  164.         (user 2)
  165.  
  166.         (set regstatus (getenv "REGSTATUS"))
  167.  
  168.         (if (= regstatus "OK")
  169.             (
  170.                 (set regstatus "PROCESSED")
  171.                 (set user_ok 1)
  172.             )
  173.         )
  174.  
  175.         (if (= regstatus "BADSER")
  176.             (
  177.                 (set reg_times (+ reg_times 1))
  178.  
  179.                 (if (= reg_times 3)
  180.                     (abort
  181.                         "Please try to install the program when you find your "
  182.                         "registration number."
  183.                     )
  184.                     (message
  185.                         "Your registration information seems to be wrong. "
  186.                         "Please re-enter the information."
  187.                     )
  188.                 )
  189.  
  190.                 (set regstatus "PROCESSED")
  191.             )
  192.         )
  193.  
  194.         (if (= regstatus "BADFILE")
  195.             (abort
  196.                 "Unable to register you copy of DeluxeMusic because "
  197.                 "a disk-related error occured."
  198.             )
  199.         )        
  200.  
  201.         (if (= regstatus "MEMORY")
  202.             (abort
  203.                 "Unable to register you copy of DeluxeMusic because "
  204.                 "there was not enough memory to perform the operation."
  205.             )
  206.         )        
  207.  
  208.         (if (= regstatus "REGTWICE")
  209.             (
  210.                 (message
  211.                     "This copy of DeluxeMusic is already registered!"
  212.                 )
  213.                 (set user_ok 1)
  214.                 (set regstatus "PROCESSED")
  215.             )
  216.         )        
  217.  
  218.         (if (<> regstatus "PROCESSED")
  219.             (abort
  220.                 "Unable to run the registration program."
  221.             )
  222.         )
  223.  
  224.         ; switch user level back
  225.  
  226.         (user orig_user_level)
  227.     )            
  228. )
  229.  
  230. (procedure install_midi
  231.     (
  232.  
  233.     ; if user has One-Stop Music Shop or Checkpoint, install driver
  234.     ; (maybe we should write a check-for-board program?) [no time for that...]
  235.  
  236.     ; switch use mode (again)
  237.  
  238.         (user 2)
  239.  
  240.         (set card_bits
  241.             (askoptions
  242.                 (prompt
  243.                     "DeluxeMusic 2.0 can support MIDI output to plug-in serial cards.\n\n"
  244.                     "Please indicate which boards are installed in your system (if any) "
  245.                     "that you want to use with this program."
  246.                 )
  247.                 (help
  248.                     "     DeluxeMusic 2.0 can send MIDI output to serial ports other than "
  249.                     "the internal serial port. These other ports are on plug-in "
  250.                     "cards that install inside an Amiga 2000/3000/4000 or other Amigas "
  251.                     "with internal plug-in-card slots.\n"
  252.                     "     Support is provided for only two plug-in cards at this time. "
  253.                     "The first is the Checkpoint Serial Solution card, which has two ports. "
  254.                     "(Note: Checkpoint in no longer in business.) The second card is "
  255.                     "a card from Blue Ribbon SoundWorks which also has two ports. One port "
  256.                     "is connected to an E-Mu Proteus SoundEngine, while the second port "
  257.                     "can be used as a regular serial port for output to external MIDI devices.\n\n"
  258.                     @askoptions-help
  259.                 )
  260.                 (choices "Checkpoint Serial Solution" "One-Stop Music Shop")
  261.                 (default 0)
  262.             )
  263.         )
  264.  
  265.  
  266.     ; switch user level back
  267.  
  268.         (user orig_user_level)
  269.  
  270.         (if card_bits
  271.             (
  272.                 (set smp_path (tackon app_volume_1 "DeluxeMusic/c/setmidiports"))
  273.  
  274.                 (set smp_help
  275.                     (cat
  276.                         "Access to third-party serial cards is controlled "
  277.                         "by the information stored in an enviroment "
  278.                         "variable. Your system has not been configured "
  279.                         "properly to use enviroment variables. This will be "
  280.                         "done by creating an ENV: and ENVARC: assignment (if "
  281.                         "needed)."
  282.                     )
  283.                 )
  284.  
  285.                 (set envarc_path (getassign "ENVARC" "a"))
  286.                 (set env_path (getassign "ENV" "a"))
  287.  
  288.                 (if (or (= envarc_path "") (= env_path ""))
  289.                     (
  290.                         (set env_answer
  291.                             (askbool
  292.                                 (prompt "Your system is not set-up for using "
  293.                                         "enviroment variables, which is required "
  294.                                         "to use serial cards with Deluxe Music. "
  295.                                         "Do you want to add enviroment variables to "
  296.                                         "your system?"
  297.                                 )
  298.                                 (help smp_help)
  299.                                 (default 1)
  300.                             )
  301.                         )
  302.  
  303.                         (if (= env_answer 0)
  304.  
  305.                             (set card_bits 0)    ; user decides against it
  306.  
  307.                             (                    ; user decides he likes the idea
  308.                                 (set env_com "")
  309.  
  310.                                 (if (= envarc_path "")
  311.                                     (
  312.                                         (makedir "SYS:env-archive")
  313.                                         (makedir "SYS:env-archive/sys")
  314.                                         (makeassign "ENVARC" "SYS:env-archive")
  315.                                         (set env_com (cat env_com "assign ENVARC: SYS:env-archive\n"))
  316.                                     )
  317.                                 )
  318.  
  319.                                 (if (= env_path "")
  320.                                     (
  321.                                         (makedir "RAM:ENV")
  322.                                         (makedir "RAM:ENV/sys")
  323.                                         (makeassign "ENV" "RAM:ENV")
  324.                                         (set env_com (cat env_com "makedir RAM:ENV\nassign ENV: RAM:ENV\n"))
  325.                                     )
  326.                                 )
  327.  
  328.                                 (startup "-- Deluxe Music --"
  329.                                     (prompt "Your enviroment variable enviroment needs to be "
  330.                                             "set-up each time your system is booted. This "
  331.                                             "requires modifying your \"user-startup\" file."
  332.                                     )
  333.                                     (help smp_help)
  334.                                     (command (cat env_com "copy ENVARC: ENV: all"))
  335.                                 )
  336.                             )
  337.                         )
  338.                     )
  339.                 )
  340.             )
  341.         )
  342.  
  343.     ;    Template: NAME,UNIT,IN,OUT,COMMENT,XMIT,RECV,INTERNAL/S,REMOVE/S,SAVE/S
  344.  
  345.         (if (bitand card_bits 1)
  346.             (
  347.                 (copyfiles
  348.                     (source (tackon app_volume_1 "DeluxeMusic/DEVS/midi"))
  349.                     (dest "DEVS:midi")
  350.                      (choices "checkpoint")
  351.                 )
  352.  
  353.                 (run 
  354.                     (cat "\"" smp_path "\" INTERNAL SAVE")
  355.                 )
  356.  
  357.                 (run 
  358.                     (cat "\"" smp_path "\" checkpoint 0 comment \"Checkpoint Unit 0\" SAVE")
  359.                 )
  360.  
  361.                 (run 
  362.                     (cat "\"" smp_path "\" checkpoint 1 comment \"Checkpoint Unit 1\" SAVE")
  363.                 )
  364.             )
  365.         )
  366.  
  367.         (if (bitand card_bits 2)
  368.             (
  369.                 (copyfiles
  370.                     (source (tackon app_volume_1 "DeluxeMusic/DEVS/midi"))
  371.                     (dest "DEVS:midi")
  372.                      (choices "OneStopMusicShop")
  373.                 )
  374.  
  375.                 (run 
  376.                     (cat "\"" smp_path "\" INTERNAL SAVE")
  377.                 )
  378.  
  379.                 (run 
  380.                     (cat "\"" smp_path "\" OneStopMusicShop 0 comment \"Music Shop SoundEngine\" SAVE")
  381.                 )
  382.  
  383.                 (run 
  384.                     (cat "\"" smp_path "\" OneStopMusicShop 1 comment \"Music Shop Serial Port\" SAVE")
  385.                 )
  386.             )
  387.         )
  388.     )
  389. )
  390.  
  391. ; handle floppy-based 'installation'
  392.  
  393. (if (not inst_mode)
  394.     (
  395.         (set @default-dest "")
  396.  
  397.         ; switch use mode (again)
  398.  
  399.         (user 2)
  400.  
  401.         (message
  402.             "\nYou should only perform a floppy installation from a copy of "
  403.             "your DeluxeMusic 2.0 program disk. If you have not made a "
  404.             "copy of the disk, please select Abort Install and make a copy. "
  405.             "Be sure to rename the copy of the disk as \"DeluxeMusic2.0\". "
  406.             "Then, open the disk icon for the copy and double click on the "
  407.             "Install-DeluxeMusic icon found there. If you ARE installing "
  408.             "from a copy, select Proceed."
  409.         )
  410.  
  411.         ; switch user level back
  412.  
  413.         (user orig_user_level)
  414.  
  415.         (complete 50)
  416.  
  417.         (set app_volume (pathonly @icon))
  418.         (set app_xpath (tackon app_volume "DeluxeMusic/DMusic"))
  419.  
  420.         (set reg_times 0)
  421.         (set user_ok 0)
  422.  
  423.         (while (not user_ok)
  424.             (
  425.                 (ask_register)
  426.  
  427.                 (do_register)
  428.             )
  429.         )
  430.  
  431.     ; if user has One-Stop Music Shop or Checkpoint, install driver
  432.  
  433.         (install_midi)
  434.  
  435.         (complete 100)
  436.  
  437.         (exit)
  438.     )
  439. )
  440.  
  441. (complete 10)
  442.  
  443. ; tell average/expert user what we'll be doing
  444.  
  445. (message
  446.    "\nYour copy of DeluxeMusic 2.0 will be installed in a new drawer named "
  447.    "\"DeluxeMusic\". You will be asked where on your hard drive "
  448.     "(or other storage device) you want this drawer created. In addition, "
  449.    "some libraries, fonts and ARexx scripts will be installed in the "
  450.    "usual places."
  451. )
  452.  
  453. (set reg_times 0)
  454. (set user_ok 0)
  455.  
  456. (while (not user_ok) (ask_register))
  457.  
  458. ; ask user where to put the drawer
  459.  
  460. (set app_locate
  461.    (askdir
  462.       (prompt "Please indicate where you want the DeluxeMusic drawer "
  463.             "to be located.")
  464.       (help @askdir-help)
  465.       (default @default-dest)
  466.    )
  467. )
  468.  
  469. ; make the main drawer
  470.  
  471. (set app_path (tackon app_locate "DeluxeMusic"))
  472.  
  473. (makedir app_path (infos))
  474.  
  475. (set @default-dest app_path)
  476.  
  477. (complete 15)
  478.  
  479. ; copy local files on disk 1 to drawer
  480.  
  481. (askdisk
  482.    (prompt "Please insert the disk labeled \"DeluxeMusic 2.0\".")
  483.    (help @askdisk-help)
  484.    (dest app_volume_name_1)
  485. )
  486.  
  487. (copyfiles
  488.    (source (tackon app_volume_1 "DeluxeMusic"))
  489.    (dest app_path)
  490.    (choices "DMusic" "DMPlayer" "Late_Notes" "Samples" "Scores")
  491.    (infos)
  492. )
  493.  
  494. (tooltype
  495.    (dest (tackon app_path "DMusic"))
  496.    (settooltype "SAMPLEPATH" "Samples")
  497. )
  498.  
  499. (complete 25)
  500.  
  501. (set app_volume app_volume_1)
  502. (set app_xpath (tackon app_path "DMusic"))
  503.  
  504. (set xxx_temp 0)
  505. (set user_ok 0)
  506.  
  507. (while (not user_ok)
  508.     (
  509.         (if xxx_temp (ask_register))
  510.  
  511.         (set xxx_temp 1)
  512.  
  513.         (do_register)
  514.     )
  515. )
  516.  
  517. (complete 30)
  518.  
  519. (copylib
  520.    (prompt "Copying \"camd\" utility library.")
  521.    (help "You will need some version of \"camd.library\" for "
  522.         "DeluxeMusic to work. A higher version number indicates a "
  523.         "newer version.")
  524.    (source (tackon app_volume_1 "DeluxeMusic/LIBS/camd.library"))
  525.    (dest "LIBS:")
  526.    (confirm)
  527. )
  528.  
  529. (complete 35)
  530.  
  531. (copylib
  532.    (prompt "Copying \"realtime\" utility library.")
  533.    (help "You will need some version of \"realtime.library\" for "
  534.         "DeluxeMusic to work. A higher version number indicates a "
  535.         "newer version.")
  536.    (source (tackon app_volume_1 "DeluxeMusic/LIBS/realtime.library"))
  537.    (dest "LIBS:")
  538.    (confirm)
  539. )
  540.  
  541. (complete 40)
  542.  
  543. (if os13
  544.    (copylib
  545.       (prompt "Copying \"gadtools13\" utility library.")
  546.       (help "You will need some version of \"gadtools13.library\" for "
  547.            "DeluxeMusic to work. A higher version number indicates a "
  548.            "newer version.")
  549.       (source (tackon app_volume_1 "DeluxeMusic/LIBS/gadtools13.library"))
  550.       (dest "LIBS:")
  551.       (confirm)
  552.    )
  553. )
  554.  
  555. (complete 45)
  556.  
  557. (if os13
  558.    (copylib
  559.       (prompt "Copying \"asl13\" utility library.")
  560.       (help "You will need some version of \"asl13.library\" for "
  561.            "DeluxeMusic to work. A higher version number indicates a "
  562.            "newer version.")
  563.       (source (tackon app_volume_1 "DeluxeMusic/LIBS/asl13.library"))
  564.       (dest "LIBS:")
  565.       (confirm)
  566.    )
  567. )
  568.  
  569. (complete 50)
  570.  
  571. (if os13
  572.     (copylib
  573.            (prompt "Copying \"iffparse\" utility library.")
  574.         (help "You will need some version of \"iffparse.library\" for "
  575.             "DeluxeMusic to work. A higher version number indicates a "
  576.             "newer version.")
  577.         (source (tackon app_volume_1 "DeluxeMusic/LIBS/iffparse.library"))
  578.            (dest "LIBS:")
  579.            (confirm)
  580.     )
  581. )
  582.  
  583. (complete 55)
  584.  
  585. (if (getassign "REXX" "a")
  586.    (copyfiles
  587.       (source (tackon app_volume_1 "DeluxeMusic/REXX"))
  588.       (dest "REXX:")
  589.       (all)
  590.    )
  591. )
  592.  
  593. (complete 60)
  594.  
  595. ;  Fonts/Duet
  596. (copyfiles
  597.    (source (tackon app_volume_1 "DeluxeMusic/FONTS"))
  598.    (dest "FONTS:")
  599.    (choices "Duet")
  600.    (fonts)
  601. )
  602.  
  603. ;  Fonts/GuitarFret
  604. (if (not (exists "FONTS:GuitarFret"))
  605.    (copyfiles
  606.       (source (tackon app_volume_1 "DeluxeMusic/FONTS"))
  607.       (dest "FONTS:")
  608.       (choices "GuitarFret")
  609.       (fonts)
  610.    )
  611. )
  612.  
  613. ;  Fonts/DMusic
  614. (if (not (exists "FONTS:DMusic"))
  615.    (copyfiles
  616.       (source (tackon app_volume_1 "DeluxeMusic/FONTS"))
  617.       (dest "FONTS:")
  618.       (choices "DMusic")
  619.       (fonts)
  620.    )
  621. )
  622.  
  623. (complete 70)
  624.  
  625. ; if user has One-Stop Music Shop or Checkpoint, install driver
  626.  
  627. (install_midi)
  628.  
  629. (complete 85)
  630.  
  631. (set examples
  632.     (askoptions
  633.         (prompt
  634.             "Which of these files do you want to install from the "
  635.             "examples disk?"
  636.         )
  637.         (choices "Samples" "Scores")
  638.         (help @askoptions-help)
  639.         (default 3)
  640.     )
  641. )
  642.  
  643. (if (not examples) (exit))
  644.  
  645. ; copy local files on disk 2 to drawer
  646.  
  647. (askdisk
  648.    (prompt "Please insert the disk labeled \"Samples\".")
  649.    (help @askdisk-help)
  650.    (dest app_volume_name_2)
  651. )
  652.  
  653. (if (bitand examples 1)
  654.     (copyfiles
  655.         (source app_volume_2)
  656.         (dest app_path)
  657.         (choices "Samples")
  658.         (infos)
  659.     )
  660. )
  661.  
  662. (if (bitand examples 2)
  663.     (copyfiles
  664.         (source app_volume_2)
  665.         (dest app_path)
  666.         (choices "Scores")
  667.     )
  668. )
  669.  
  670. (complete 100)
  671.